For this week’s assignment, we had to use the desktop milling machine to produce a printed circuit board (PCB).
The PCB I selected to mill is The FabISP which is an in-system programmer for AVR microcontrollers, designed for production within a FabLab (minimum set of simple instructions). It allows you to program the microcontrollers on other boards you make.
The first step for this week’s assignment is to select the design of the FABISP which I am going to use, and download a Png format for the outlines and the traces, I selected Ali’s version which is similar to Neil’s but with some differences in the area optimization and jumbers, and since we don’t have a 1.5k ohm resistors in our lab, I selected the 1+.5 k ohm version.
I started with engraving the traces. in order to set the settings needed to engrave the board, I used a cam software which developed by fab foundation which is fab modules.
The interface of the software very simple, you just have to select the input and output formats and then select the process type, see figures below.
The setting for the traces engrave using a pit mill 1/64 inch are shown in the image below.
After saving the rml file in the desktop, I opened the software that controls the machine which is Vpanel for SRM-20, and centered the cutting knife (1/64) on the zero for x,y,z axes.
After setting the zero, I selected the engrave file from the desktop and then press OUTPUT, the machine will start working. I did exactly the same for the outline cutting file also.
After cutting the board and cleaning it with water and brush, I started soldering it in the lab, first step was covering all traces with soldering tin, to make the soldering process easier.
The components I soldered in my boared are:
1. Attiny 44
2. 100 ohm resistor x2
3. 10k ohm resistor x1
4. 1k ohm resistor x1
5. 499 ohm resistor x1
6. 0 ohm resistor x1
7. 20 MHz crystal
8. 1µf capacitor
9. 6-pin header
See img below for the final look of my ISP board after soldering all components from a microscope lens.
We had to program the boared in linux’s Ubuntu operating system, in order to do that we used a bootable usb to operate the PC from it. Fortunately, our instructor, Nadine, gave us a step by step tutorial about all the programming producer, and we used this tutorial to make better understanding of the process.
After opening the Ubuntu, you have to open the terminal and start downloading the needed drivers and packages by typing the following lines:
sudo apt-get install flex byacc bison gcc libusb-dev avrdude
sudo apt-get install gcc-avr
sudo apt-get install avr-libc
sudo apt-get install libc6-dev
after installing these libraries, we had to install the firmware on the desktop and unzip it, by typing the following lines:
cd ~/Desktop
wget http://academy.cba.mit.edu/classes/embedded_programming/firmware.zip
unzip firmware.zip
as I mentioned before, we need this board to program the boards that we will design and produce in the future weeks during this course, so, we have to program it to make it a programmer! to do that I used a commercial programmer which is Arduino. To make it simple, the Arduino will do the job that our board have to do for other boards in the future
the Arduino is a commercial board which are pre-programmed with a boot loader that simplifies uploading of programs to the on-chip flash memory, in our case we wanted to upload a code that makes it an ISP board, to do that open Arduino software, and from file menu select examples and then select Arduino as ISP.
From the cod page that appears, I selected the setting options for programming the arduino as seen in image below
And then press UPLOADE, now your Arduino acts like an ISP, which can program any board.
To delete any old executable files and add the updated file, type the following lines:
make clean
: Deletes existing executable files in the directory.
make hex
: Creates new updated files.
The last stage of this process is connecting the board to the Arduino, and do the following steps:
1. open the makefile text that excite in the firmware folder that we downloaded before, add # to this lineAVRDUDE = avrdude -c avrisp2 -P usb -p $(DEVICE)
to make it a comment, and add this line instead of it AVRDUDE = avrdude -c stk500v1 -P /dev/ttyACM0 -b19200 -p $(DEVICE)
2. execute this line to link the edited makefile text with the firmware
sudo make fuse
3. execute this line to compile the program.
sudo make program
One of the items in the list should be Multiple vendors usbtinv
which is your ISP.
Here is my full terminal :
ubuntu@ubuntu:~$ sudo apt-get install flex byacc bison gcc libusb-dev avrdude Reading package lists... Done Building dependency tree Reading state information... Done gcc is already the newest version (4:7.4.0-1ubuntu2.3). bison is already the newest version (2:3.0.4.dfsg-1build1). flex is already the newest version (2.6.4-6). libusb-dev is already the newest version (2:0.1.12-31). avrdude is already the newest version (6.3-4). byacc is already the newest version (20140715-1build1). 0 upgraded, 0 newly installed, 0 to remove and 73 not upgraded. ubuntu@ubuntu:~$ sudo apt-get install gcc-avr Reading package lists... Done Building dependency tree Reading state information... Done gcc-avr is already the newest version (1:5.4.0+Atmel3.6.0-1build1). 0 upgraded, 0 newly installed, 0 to remove and 73 not upgraded. ubuntu@ubuntu:~$ sudo apt-get install avr-libc Reading package lists... Done Building dependency tree Reading state information... Done avr-libc is already the newest version (1:2.0.0+Atmel3.6.0-1). 0 upgraded, 0 newly installed, 0 to remove and 73 not upgraded. ubuntu@ubuntu:~$ sudo apt-get install libc6-dev Reading package lists... Done Building dependency tree Reading state information... Done libc6-dev is already the newest version (2.27-3ubuntu1). 0 upgraded, 0 newly installed, 0 to remove and 73 not upgraded. ubuntu@ubuntu:~$ cd ~/Desktop ubuntu@ubuntu:~/Desktop$ wget http://academy.cba.mit.edu/classes/embedded_programming/firmware.zip --2020-02-25 11:11:34-- http://academy.cba.mit.edu/classes/embedded_programming/firmware.zip Resolving academy.cba.mit.edu (academy.cba.mit.edu)... 18.27.130.25 Connecting to academy.cba.mit.edu (academy.cba.mit.edu)|18.27.130.25|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 141728 (138K) [application/zip] Saving to: ‘firmware.zip’ firmware.zip 100%[===================>] 138.41K --.-KB/s in 0.08s 2020-02-25 11:11:36 (1.63 MB/s) - ‘firmware.zip’ saved [141728/141728] ubuntu@ubuntu:~/Desktop$ unzip firmware.zip Archive: firmware.zip creating: fabISP_mac.0.8.2_firmware/ inflating: fabISP_mac.0.8.2_firmware/.DS_Store creating: __MACOSX/ creating: __MACOSX/fabISP_mac.0.8.2_firmware/ inflating: _MACOSX/fabISP_mac.0.8.2_firmware/..DS_Store inflating: fabISP_mac.0.8.2_firmware/main.c inflating: __MACOSX/fabISP_mac.0.8.2_firmware/._main.c inflating: fabISP_mac.0.8.2_firmware/main.elf inflating: fabISP_mac.0.8.2_firmware/main.hex inflating: fabISP_mac.0.8.2_firmware/main.o inflating: fabISP_mac.0.8.2_firmware/Makefile inflating: __MACOSX/fabISP_mac.0.8.2_firmware/._Makefile inflating: fabISP_mac.0.8.2_firmware/usbconfig.h inflating: __MACOSX/fabISP_mac.0.8.2_firmware/._usbconfig.h creating: fabISP_mac.0.8.2_firmware/usbdrv/ inflating: fabISP_mac.0.8.2_firmware/usbdrv/.DS_Store creating: __MACOSX/fabISP_mac.0.8.2_firmware/usbdrv/ inflating: _MACOSX/fabISP_mac.0.8.2_firmware/usbdrv/..DS_Store inflating: fabISP_mac.0.8.2_firmware/usbdrv/asmcommon.inc inflating: __MACOSX/fabISP_mac.0.8.2_firmware/usbdrv/._asmcommon.inc inflating: fabISP_mac.0.8.2_firmware/usbdrv/Changelog.txt inflating: __MACOSX/fabISP_mac.0.8.2_firmware/usbdrv/._Changelog.txt inflating: fabISP_mac.0.8.2_firmware/usbdrv/CommercialLicense.txt inflating: __MACOSX/fabISP_mac.0.8.2_firmware/usbdrv/._CommercialLicense.txt inflating: fabISP_mac.0.8.2_firmware/usbdrv/License.txt inflating: __MACOSX/fabISP_mac.0.8.2_firmware/usbdrv/._License.txt inflating: fabISP_mac.0.8.2_firmware/usbdrv/oddebug.c inflating: __MACOSX/fabISP_mac.0.8.2_firmware/usbdrv/._oddebug.c inflating: fabISP_mac.0.8.2_firmware/usbdrv/oddebug.h inflating: __MACOSX/fabISP_mac.0.8.2_firmware/usbdrv/._oddebug.h inflating: fabISP_mac.0.8.2_firmware/usbdrv/oddebug.o inflating: fabISP_mac.0.8.2_firmware/usbdrv/Readme.txt inflating: __MACOSX/fabISP_mac.0.8.2_firmware/usbdrv/._Readme.txt inflating: fabISP_mac.0.8.2_firmware/usbdrv/USB-ID-FAQ.txt inflating: __MACOSX/fabISP_mac.0.8.2_firmware/usbdrv/._USB-ID-FAQ.txt inflating: fabISP_mac.0.8.2_firmware/usbdrv/USB-IDs-for-free.txt inflating: __MACOSX/fabISP_mac.0.8.2_firmware/usbdrv/._USB-IDs-for-free.txt inflating: fabISP_mac.0.8.2_firmware/usbdrv/usbconfig-prototype.h inflating: __MACOSX/fabISP_mac.0.8.2_firmware/usbdrv/._usbconfig-prototype.h inflating: fabISP_mac.0.8.2_firmware/usbdrv/usbdrv.c inflating: __MACOSX/fabISP_mac.0.8.2_firmware/usbdrv/._usbdrv.c inflating: fabISP_mac.0.8.2_firmware/usbdrv/usbdrv.h inflating: __MACOSX/fabISP_mac.0.8.2_firmware/usbdrv/._usbdrv.h inflating: fabISP_mac.0.8.2_firmware/usbdrv/usbdrv.o inflating: fabISP_mac.0.8.2_firmware/usbdrv/usbdrvasm.asm inflating: __MACOSX/fabISP_mac.0.8.2_firmware/usbdrv/._usbdrvasm.asm inflating: fabISP_mac.0.8.2_firmware/usbdrv/usbdrvasm.o inflating: fabISP_mac.0.8.2_firmware/usbdrv/usbdrvasm.S inflating: __MACOSX/fabISP_mac.0.8.2_firmware/usbdrv/._usbdrvasm.S inflating: fabISP_mac.0.8.2_firmware/usbdrv/usbdrvasm12.inc inflating: __MACOSX/fabISP_mac.0.8.2_firmware/usbdrv/._usbdrvasm12.inc inflating: fabISP_mac.0.8.2_firmware/usbdrv/usbdrvasm128.inc inflating: __MACOSX/fabISP_mac.0.8.2_firmware/usbdrv/._usbdrvasm128.inc inflating: fabISP_mac.0.8.2_firmware/usbdrv/usbdrvasm15.inc inflating: __MACOSX/fabISP_mac.0.8.2_firmware/usbdrv/._usbdrvasm15.inc inflating: fabISP_mac.0.8.2_firmware/usbdrv/usbdrvasm16.inc inflating: __MACOSX/fabISP_mac.0.8.2_firmware/usbdrv/._usbdrvasm16.inc inflating: fabISP_mac.0.8.2_firmware/usbdrv/usbdrvasm165.inc inflating: __MACOSX/fabISP_mac.0.8.2_firmware/usbdrv/._usbdrvasm165.inc inflating: fabISP_mac.0.8.2_firmware/usbdrv/usbdrvasm18-crc.inc inflating: __MACOSX/fabISP_mac.0.8.2_firmware/usbdrv/._usbdrvasm18-crc.inc inflating: fabISP_mac.0.8.2_firmware/usbdrv/usbdrvasm20.inc inflating: __MACOSX/fabISP_mac.0.8.2_firmware/usbdrv/._usbdrvasm20.inc inflating: fabISP_mac.0.8.2_firmware/usbdrv/USBID-License.txt inflating: __MACOSX/fabISP_mac.0.8.2_firmware/usbdrv/._USBID-License.txt inflating: fabISP_mac.0.8.2_firmware/usbdrv/usbportability.h inflating: __MACOSX/fabISP_mac.0.8.2_firmware/usbdrv/._usbportability.h ubuntu@ubuntu:~/Desktop$ make fuse make: * No rule to make target 'fuse'. Stop. ubuntu@ubuntu:~/Desktop$ cd fabISP_mac.0.8.2_firmware/ ubuntu@ubuntu:~/Desktop/fabISP_mac.0.8.2_firmware$ make clean rm -f main.hex main.lst main.obj main.cof main.list main.map main.eep.hex main.elf .o usbdrv/.o main.s usbdrv/oddebug.s usbdrv/usbdrv.s ubuntu@ubuntu:~/Desktop/fabISP_mac.0.8.2_firmware$ make hex avr-gcc -Wall -Os -DF_CPU=20000000 -Iusbdrv -I. -DDEBUG_LEVEL=0 -mmcu=attiny44 -c usbdrv/usbdrv.c -o usbdrv/usbdrv.o avr-gcc -Wall -Os -DF_CPU=20000000 -Iusbdrv -I. -DDEBUG_LEVEL=0 -mmcu=attiny44 -x assembler-with-cpp -c usbdrv/usbdrvasm.S -o usbdrv/usbdrvasm.o avr-gcc -Wall -Os -DF_CPU=20000000 -Iusbdrv -I. -DDEBUG_LEVEL=0 -mmcu=attiny44 -c usbdrv/oddebug.c -o usbdrv/oddebug.o avr-gcc -Wall -Os -DF_CPU=20000000 -Iusbdrv -I. -DDEBUG_LEVEL=0 -mmcu=attiny44 -c main.c -o main.o main.c:88:13: warning: always_inline function might not be inlinable [-Wattributes] static void delay ( void ) ^ avr-gcc -Wall -Os -DF_CPU=20000000 -Iusbdrv -I. -DDEBUG_LEVEL=0 -mmcu=attiny44 -o main.elf usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o main.o rm -f main.hex main.eep.hex avr-objcopy -j .text -j .data -O ihex main.elf main.hex avr-size main.hex text data bss dec hex filename 0 1984 0 1984 7c0 main.hex ubuntu@ubuntu:~/Desktop/fabISP_mac.0.8.2_firmware$ sudo make fuse avrdude -c stk500v1 -p /dev/ttyACM0 -b19200 -p attiny44 -U hfuse:w:0xDF:m -U lfuse:w:0xFF:m avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00 avrdude done. Thank you. Makefile:120: recipe for target 'fuse' failed make: * [fuse] Error 1 ubuntu@ubuntu:~/Desktop/fabISP_mac.0.8.2_firmware$ sudo make fuse avrdude -c stk500v1 -p /dev/ttyACM0 -b19200 -p attiny44 -U hfuse:w:0xDF:m -U lfuse:w:0xFF:m avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00 avrdude done. Thank you. Makefile:120: recipe for target 'fuse' failed make: * [fuse] Error 1 ubuntu@ubuntu:~/Desktop/fabISP_mac.0.8.2_firmware$ sudo make fuse avrdude -c stk500v1 -P /dev/ttyACM0 -b19200 -p attiny44 -U hfuse:w:0xDF:m -U lfuse:w:0xFF:m avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.02s avrdude: Device signature = 0x1e9207 (probably t44) avrdude: reading input file "0xDF" avrdude: writing hfuse (1 bytes): Writing | ################################################## | 100% 0.01s avrdude: 1 bytes of hfuse written avrdude: verifying hfuse memory against 0xDF: avrdude: load data hfuse data from input file 0xDF: avrdude: input file 0xDF contains 1 bytes avrdude: reading on-chip hfuse data: Reading | ################################################## | 100% 0.01s avrdude: verifying ... avrdude: 1 bytes of hfuse verified avrdude: reading input file "0xFF" avrdude: writing lfuse (1 bytes): Writing | ################################################## | 100% 0.01s avrdude: 1 bytes of lfuse written avrdude: verifying lfuse memory against 0xFF: avrdude: load data lfuse data from input file 0xFF: avrdude: input file 0xFF contains 1 bytes avrdude: reading on-chip lfuse data: Reading | ################################################## | 100% 0.01s avrdude: verifying ... avrdude: 1 bytes of lfuse verified avrdude: safemode: Fuses OK (E:FF, H:DF, L:FF) avrdude done. Thank you. ubuntu@ubuntu:~/Desktop/fabISP_mac.0.8.2_firmware$ sudo make program avrdude -c stk500v1 -P /dev/ttyACM0 -b19200 -p attiny44 -U flash:w:main.hex:i avrdude: ser_open(): can't open device "/dev/ttyACM0": No such file or directory avrdude done. Thank you. Makefile:127: recipe for target 'flash' failed make: * [flash] Error 1 ubuntu@ubuntu:~/Desktop/fabISP_mac.0.8.2_firmware$ sudo make program avrdude -c stk500v1 -P /dev/ttyACM0 -b19200 -p attiny44 -U flash:w:main.hex:i avrdude: ser_open(): can't open device "/dev/ttyACM0": No such file or directory avrdude done. Thank you. Makefile:127: recipe for target 'flash' failed make: * [flash] Error 1 ubuntu@ubuntu:~/Desktop/fabISP_mac.0.8.2_firmware$ sudo make program avrdude -c stk500v1 -P /dev/ttyACM0 -b19200 -p attiny44 -U flash:w:main.hex:i avrdude: ser_open(): can't open device "/dev/ttyACM0": No such file or directory avrdude done. Thank you. Makefile:127: recipe for target 'flash' failed make: * [flash] Error 1 ubuntu@ubuntu:~/Desktop/fabISP_mac.0.8.2_firmware$ sudo make program avrdude -c stk500v1 -P /dev/ttyACM0 -b19200 -p attiny44 -U flash:w:main.hex:i avrdude: ser_open(): can't open device "/dev/ttyACM0": No such file or directory avrdude done. Thank you. Makefile:127: recipe for target 'flash' failed make: * [flash] Error 1 ubuntu@ubuntu:~/Desktop/fabISP_mac.0.8.2_firmware$ sudo make program avrdude -c stk500v1 -P /dev/ttyACM0 -b19200 -p attiny44 -U flash:w:main.hex:i avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.02s avrdude: Device signature = 0x1e9207 (probably t44) avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed To disable this feature, specify the -D option. avrdude: erasing chip avrdude: reading input file "main.hex" avrdude: writing flash (1984 bytes): Writing | ################################################## | 100% 2.79s avrdude: 1984 bytes of flash written avrdude: verifying flash memory against main.hex: avrdude: load data flash data from input file main.hex: avrdude: input file main.hex contains 1984 bytes avrdude: reading on-chip flash data: Reading | ################################################## | 100% 1.40s avrdude: verifying ... avrdude: 1984 bytes of flash verified avrdude: safemode: Fuses OK (E:FF, H:DF, L:FF) avrdude done. Thank you. avrdude -c stk500v1 -P /dev/ttyACM0 -b19200 -p attiny44 -U hfuse:w:0xDF:m -U lfuse:w:0xFF:m avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.02s avrdude: Device signature = 0x1e9207 (probably t44) avrdude: reading input file "0xDF" avrdude: writing hfuse (1 bytes): Writing | ################################################## | 100% 0.01s avrdude: 1 bytes of hfuse written avrdude: verifying hfuse memory against 0xDF: avrdude: load data hfuse data from input file 0xDF: avrdude: input file 0xDF contains 1 bytes avrdude: reading on-chip hfuse data: Reading | ################################################## | 100% 0.01s avrdude: verifying ... avrdude: 1 bytes of hfuse verified avrdude: reading input file "0xFF" avrdude: writing lfuse (1 bytes): Writing | ################################################## | 100% 0.01s avrdude: 1 bytes of lfuse written avrdude: verifying lfuse memory against 0xFF: avrdude: load data lfuse data from input file 0xFF: avrdude: input file 0xFF contains 1 bytes avrdude: reading on-chip lfuse data: Reading | ################################################## | 100% 0.01s avrdude: verifying ... avrdude: 1 bytes of lfuse verified avrdude: safemode: Fuses OK (E:FF, H:DF, L:FF) avrdude done. Thank you. ubuntu@ubuntu:~/Desktop/fabISP_mac.0.8.2_firmware$ lsusb Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 004: ID 045e:07f9 Microsoft Corp. Bus 001 Device 003: ID 045e:00cb Microsoft Corp. Basic Optical Mouse v2.0 Bus 001 Device 002: ID 058f:6387 Alcor Micro Corp. Flash Drive Bus 001 Device 012: ID 1781:0c9f Multiple Vendors USBtiny Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub ubuntu@ubuntu:~/Desktop/fabISP_mac.0.8.2_firmware$
I didn’t face any trouble during the manufacturing process for the board, the milling and soldering stages went very smooth, but when I started the programming step I had a problem with the Ubuntu system, it kept giving me this error about problems with finding the packages for some libraries, each time I write the first installation command.
To solve it, from the software settings in the Ubuntu, I changed the server to the united states server because im using the ubunu from a bootable flash drive and its not installed to the PC, and checked all the options like below, and retyped the command and it installed the required libraries successfully.
Heroshot for my board